import $service from '../../../../../service.js';
var hospital_id="1";
var that;
var inquiry_patient_id;
var doctor_id;
Page({
    data:{
       active : true,
       list:[]
    },
    onLoad(e){
        inquiry_patient_id = e.inquiry_patient_id
    },
    onShow(){
        that = this.data;
        this.doctorSide_personal_inquiry_getPatientHistoryInquiryLog()
    },
    //数据
    doctorSide_personal_inquiry_getPatientHistoryInquiryLog:function(){
        var jsonData ={
            "inquiry_patient_id" : inquiry_patient_id
        }
        var jsonAjax = {
            "url": "doctorSide_personal_inquiry_getPatientHistoryInquiryLog.do",
            "jsonData": jsonData,
        }
        $service.getAjaxData(jsonAjax, this.doctorSide_personal_inquiry_getPatientHistoryInquiryLog_back);
    },
    //回调
    doctorSide_personal_inquiry_getPatientHistoryInquiryLog_back: function(jsonBack){
         var data=$service.strToJson(jsonBack.data).data;
         var list = data.inquiryLogList;//诊断结果
         for (var i = 0; i < list.length; i++) {
              list[i].lrsj2 = $service.nothinglrsj(list[i].lrsj)
         }
         this.setData({
             list : list
         })
    },
    gotodetalis(e){
        var index = e.currentTarget.dataset.index;
        var num = e.currentTarget.dataset.num;
        var z = e.currentTarget.dataset.upindex;
        if(index == 1){//检验检查
            $service.openPage('../../../../user_side/index/index_inspection_inspection/index_inspection_inspection?checklist_id=' + this.data.list[z].checklistList[num].checklist_id)
        }else if(index == 2){//健康指导
            $service.openPage('../../../../user_side/index/index_health_guidance/index_health_guidance?guidance_id=' + this.data.list[z].guidanceList[num].guidance_id)
        }else if(index == 3){//住院建议
            $service.openPage('../../../../user_side/index/index_recommendations_hospitalization/index_recommendations_hospitalization?hospitalization_id=' + this.data.list[z].hospitalizationList[num].hospitalization_id)
        }else if(index == 4){//处方
            $service.openPage('../../../../user_side/index/index_prescription_details/index_prescription_details?prescription_id=' + this.data.list[z].prescriptionList[num].prescription_id)
        }else if(index == 5){//查看图片
            $service.openPage('../../../../user_side/index/index_picturelist/index_picturelist?prescription_id=' + this.data.list[z].log_id)
        }
    }
})